<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <title>数据列表页面</title>
    <!-- layui.css -->
    <link href="__PLUGIN__/layui/css/layui.css" rel="stylesheet" />
</head>
<body>
<fieldset id="dataList" class="layui-elem-field layui-field-title sys-list-field">
    <legend>添加文章</legend>
    <div class="layui-field-box">
        <form class="layui-form" action="{:url('save')}" method="post" enctype="multipart/form-data">
            <div class="layui-form-item">
                <label class="layui-form-label">标题</label>
                <div class="layui-input-block">
                    <input type="text" name="title" required  lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">图片</label>
                <div class="layui-input-block">
                    <input type="file" name="image" style="display: none" id="image" class="layui-upload-file">
                    <button type="button" class="layui-btn" id="Browse">
                        <i class="layui-icon ">&#xe62f;</i>上传图片
                    </button>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">分类</label>
                <div class="layui-input-block">
                    <select name="cid" id="">
                        <option value="请选择分类"></option>
                        {volist name="res" id="val"}
                        <option value="{$val.id}">{$val.cate}</option>
                        {/volist}
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">概要</label>
                <div class="layui-input-block">
                    <input type="text" name="outline" required  lay-verify="required" placeholder="请输入概要" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">状态</label>
                <div class="layui-input-block">
                    <input type="radio" name="status" value="1" title="显示" checked>
                    <input type="radio" name="status" value="0" title="不显示">
                </div>
            </div>
            <div class="layui-form-item pcontent">
                <label class="layui-form-label">内容</label>
                <div class="layui-input-block">
                    <script id="article-content" name="content" type="text/plain"></script>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button type="submit" class="layui-btn" id="submit">立即提交</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </div>
        </form>
    </div>
</fieldset>
<!-- layui.js -->
<script src="__PLUGIN__/layui/layui.js"></script>
<script src="__PLUGIN__/jquery/jquery-2.2.4.js"></script>
<script src="__PLUGIN__/editor/ueditor.config.js"></script>
<script src="__PLUGIN__/editor/ueditor.all.min.js"></script>
<script type="text/javascript" charset="utf-8" src="__PLUGIN__/editor/lang/zh-cn/zh-cn.js"></script>
<script>
    layui.use('form', function(){
        var form = layui.form;
    });
    $('#Browse').click(function () {
        $('#image').click()
    })
    var ue = UE.getEditor('article-content', {
        autoHeight: false,
        initialFrameHeight:500
    });
    $('#submit').click(function () {
        window.parent.location.reload();
        var index = parent.layer.getFrameIndex(window.name);
        parent.layer.close(index);
    })
</script>
<!-- layui规范化用法 -->
</body>
</html>